//
//  HELExamVC.m
//  HandheldELearn
//
//  Created by 陈武琦 on 16/7/21.
//  Copyright © 2016年 陈武琦. All rights reserved.
//

#import "HELExamVC.h"
#import "HELMaterialExamVC.h"
#import "YSLContainerViewController.h"
@interface HELExamVC ()<YSLContainerViewControllerDelegate>

@end

@implementation HELExamVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = HexRGB_WSJ(242, 243, 244);
 
    if (self.type == HELExamVCType_MyExam) {
         [self titleView:@"我的考试"];
    }else{
        [self titleView:@"题库考试"];
    }
   
  
    [self setUp];
    // Do any additional setup after loading the view.
}

- (void)setUp {
    NSArray *arr = nil;
    if (self.type == HELExamVCType_MyExam) {
        HELMaterialExamVC *materialVC = [[HELMaterialExamVC alloc] initWithExamType:HELExamTypeMyExam_hospital];
        materialVC.title = @"院内推送";
        HELMaterialExamVC *simulationVC = [[HELMaterialExamVC alloc] initWithExamType:HELExamTypeMyExam_record];
        simulationVC.title = @"考试记录";
        arr =[@[materialVC,simulationVC] copy];
    }else{
        HELMaterialExamVC *materialVC = [[HELMaterialExamVC alloc] initWithExamType:HELExamTypeExamExcise_hospital];
        materialVC.title = @"院内考试";
       
        HELMaterialExamVC *simulationVC = [[HELMaterialExamVC alloc] initWithExamType:HELExamTypeExamExcise_public];
        simulationVC.title = @"公开题库";
        arr =[@[materialVC,simulationVC] copy];
       
    }
   
   
    YSLContainerViewController *containerVC = [[YSLContainerViewController alloc]initWithControllers:arr
                                                                                        topBarHeight:0
                                                                                parentViewController:self];
    containerVC.delegate = self;
    containerVC.menuItemFont = [UIFont fontWithName:@"Futura-Medium" size:16];
    containerVC.menuItemTitleColor = kTxtColor;
    containerVC.menuItemSelectedTitleColor = kMainColor;
    containerVC.menuIndicatorColor = kMainColor;
    containerVC.menuBackGroudColor = [UIColor whiteColor];
    [self.view addSubview:containerVC.view];
}


#pragma mark -- YSLContainerViewControllerDelegate
- (void)containerViewItemIndex:(NSInteger)index currentController:(UIViewController *)controller
{
    //    NSLog(@"current Index : %ld",(long)index);
    //    NSLog(@"current controller : %@",controller);
    //    [controller viewWillAppear:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
